package com.zj.ssm.controller;

import com.zj.ssm.pojo.domain.News;
import com.zj.ssm.pojo.domain.Status;
import com.zj.ssm.pojo.domain.vo.NewsVO;
import com.zj.ssm.result.AjaxResult;
import com.zj.ssm.service.NewsApprovalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.crypto.interfaces.PBEKey;

/**
 * @author wxr
 * @version 1.0
 * @date 2022/2/17 16:07
 */
@RestController
@RequestMapping("verify")
public class NewsApprovalController {
    @Autowired
    private NewsApprovalService newsApprovalService;

    /**      新闻审核通过按钮    */
    @RequestMapping("pass/{id}")
    public AjaxResult pass(@PathVariable("id")Integer id){
        return newsApprovalService.pass(id);
    }

//    @RequestMapping("passUpdate")
//    public AjaxResult passUpdate(NewsVO news){
//        return newsApprovalService.passUpdate(news);
//    }


/**      不通过按钮    */
    @RequestMapping("revert")
    public AjaxResult reason(NewsVO newsVO){
        System.out.println(newsVO);
        return newsApprovalService.reason(newsVO);
    }



}
